

boolean TST(boolean *lock) {
    boolean b = *lock;
    *lock = TRUE;
    return b;
}